// ChildFrameDebug.cpp : implementation file
//

#include "stdafx.h"
#include "waveeditor.h"
#include "MainFrm.h"
#include "ChildFrameDebug.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CChildFrameDebug

IMPLEMENT_DYNCREATE(ChildDebugFrame, CMDIChildWnd)

ChildDebugFrame::ChildDebugFrame()
{
}

ChildDebugFrame::~ChildDebugFrame()
{
}

BOOL ChildDebugFrame::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs
	CRect framerect;
	CRect srect;
	CRect trect;

	ParentMainFrame *pMainFrame = (ParentMainFrame *) AfxGetMainWnd();
	pMainFrame->GetClientRect(&framerect);
	pMainFrame->m_wndStatusBar	.GetWindowRect(&srect);
	pMainFrame->m_wndToolBar	.GetWindowRect(&trect);
	int	height	=	framerect.Height()-srect.Height()*2-trect.Height();
	cs.x		=	framerect.left;
	cs.y		=	height - DEBUG_WINDOW_HEIGHT;
	cs.cx		=	framerect.right;
	cs.cy		=	DEBUG_WINDOW_HEIGHT;
	cs.style	&= ~(WS_MAXIMIZEBOX|WS_MINIMIZEBOX |WS_SYSMENU);
	cs.lpszName	=	"FUCK";
	if( !CMDIChildWnd::PreCreateWindow(cs) )
		return FALSE;

	return TRUE;
}

BEGIN_MESSAGE_MAP(ChildDebugFrame, CMDIChildWnd)
	//{{AFX_MSG_MAP(CChildFrameDebug)
	//}}AFX_MSG_MAP
	ON_WM_SIZING()
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CChildFrameDebug message handlers

/////////////////////////////////////////////////////////////////////////////
// CChildFrame diagnostics

#ifdef _DEBUG
void ChildDebugFrame::AssertValid() const
{
	CMDIChildWnd::AssertValid();
}

void ChildDebugFrame::Dump(CDumpContext& dc) const
{
	CMDIChildWnd::Dump(dc);
}

#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CChildFrame message handlers







void ChildDebugFrame::OnSizing(UINT fwSide, LPRECT pRect)
{
	CMDIChildWnd::OnSizing(fwSide, pRect);

	// TODO: Add your message handler code here
	CRect framerect;
	CRect srect;
	CRect trect;

	// TODO: Add your message handler code here
	ParentMainFrame *pMainFrame = (ParentMainFrame *) AfxGetMainWnd();
	pMainFrame->GetClientRect(&framerect);
	pMainFrame->m_wndStatusBar	.GetWindowRect(&srect);
	pMainFrame->m_wndToolBar	.GetWindowRect(&trect);
	int	height	=	framerect.Height()-srect.Height()*2-trect.Height();
	RECT	cs;
	cs.left		=	framerect.left;
	cs.top		=	height - DEBUG_WINDOW_HEIGHT;
	cs.right	=	framerect.left+framerect.right;
	cs.bottom	=	height;
	MoveWindow(&cs);
}
